#include "apilib.h"

int rand(void); //产生0~32767的随机数

void HariMain(void)
{
    char *buf;
    int win, i, x, y;
    api_initmalloc();
    buf = api_malloc(150 * 100);
    win = api_win_create(buf, 150, 100, -1, "stars");
    api_win_boxfil(win, 6, 26, 143, 93, 0);
    for (i = 0; i < 50; i++)
    {
        x = (rand() % 137) + 6;
        y = (rand() % 67) + 26;
        api_win_point(win + 1, x, y, 3);
    }
    api_win_refrsh(win, 6, 26, 144, 94);
    for (;;)
    {
        if (api_getkey(1) == 0x0a)
            break;
    }
    api_exit();
}
